package com.zhijian.wharf.aop;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author HCG
 * @version 1.0
 * @date 2024-06-17
 */
@Aspect
@Component
@Slf4j
public class OperationAspect {

    @Autowired
    private ApiAopSaveComp apiAopSaveComp;

    @Pointcut("@annotation(com.zhijian.wharf.annotation.LogOperation)")
    public void logPointCut() {

    }

    @Around("logPointCut()")
    public Object around(ProceedingJoinPoint point) throws Throwable {
        return apiAopSaveComp.onAround(point);
    }
}
